package omm.domain;


import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;

import omm.domain.Quotation.State;
import omm.domain.enums.Commission;

public class CommissionStrategy {
	
	Commission commition;
	
	public CommissionStrategy(Commission commition){
		this.commition = commition;
	}
	
	public boolean conditionToKeep(State state) {
		//TODO: Ver de sacar lo q no es lost won y quoted de la lista
		if (commition == Commission.ALL){
			if(state == State.LOST || state == State.WON || state == State.QUOTED)
				return true;
		}
		return (commition.name() == state.name());
	}
	
	public String getTitle(){
		if(commition == Commission.LOST){
			return "perdidas";
		}else if(commition == Commission.WON){
			return "ganadas";
		}else if(commition == Commission.QUOTED){
			return "pendientes";
		}
		return "";
	}
	public String getName(String won,String lost,String quoted,String all){
		switch(commition){
		case WON: return won;
		case LOST: return lost;
		case QUOTED: return quoted;
		default: return all;
		}
	}
	
}
